//
//  LKMPushManager.swift
//  weile
//
//  Created by LKM on 16/11/2.
//  Copyright © 2016年 LKM. All rights reserved.
//

import UIKit
import Foundation
import SwiftyJSON

class LKMPushManager : AnyObject{

    static let  pushHandleList : [Int:PushHandleAble] =
    [
        11:PushWebUrlHandle(),
        12:PushProductsHandle(),
        13:PushProductDetailHandle(),
        14:PushArticleDetailHandel(),
        15:PushUserCenterMsgHandel()
    ]

    public class func getPushHandle(forType:Int) -> PushHandleAble?{
        return pushHandleList[forType]
    }
    
    //处理发送过来的
    class func Handel(type:Int,data:[String: JSON]?){
        let hc : PushHandleAble? = getPushHandle(forType: type)
        if hc == nil{
            return;
        }
     
        
        hc!.handler(data: hc!.toData(forJSONWrap: data ));
        
    }
    
}
